<template>
    <div class="title-two" @click="linkTo">
        <span class="title-text">{{content.value}}</span>
    </div>
</template>

<script>
    export default {
        name: 'TitleTwo',
        props: {
            content: {
                type: Object,
                default: _ => {
                    return {
                        value: '标题文字',
                        link: ''
                    };
                }
            }
        },
        methods: {
            linkTo() {
                let link = this.content.link;
                link && window.open(link);
            }
        }
    }
</script>

<style scoped lang="scss">
    .title-two {
        height: 100%;
        font-size: 20px;
        line-height: 30px;
        position: relative;
        text-align: center;
        font-weight: 600;
        cursor: pointer;
        background-color: rgba(204, 204, 204, .3);

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
</style>
